package com.nineclock.system.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nineclock.system.mapper.SysUserMapper;
import com.nineclock.system.pojo.SysUser;
import com.nineclock.system.service.SysUserService;
import org.springframework.stereotype.Service;

@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {


    /**
     * 判断手机号在sysuser表中是否存在
     *
     * @param mobile
     * @return
     */
    @Override
    public Boolean checkMobileExists(String mobile) {
        int count = this.count(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getMobile, mobile));
        return count >= 1;
    }
}
